<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:if test="${sessionScope.mvo==null }">
<jsp:forward page="../index.jsp"></jsp:forward>
</c:if>
<c:set var="gvo" value="${requestScope.gvo.gvo }"></c:set>
<form action="gallery.do" method="post" id="updateForm" enctype="multipart/form-data">
<input type="hidden" name="mode" value="update">
<input type="hidden" name="no" value="${gvo.no }">
<input type="hidden" name="orgImgName" value="${gvo.orgImgName }">
<input type="hidden" name="thumbImgName" value="${gvo.thumbImgName }">
<table>
<tr>
	<td>사진</td>
	<td>
		<img src="/img/thumb_gal/${gvo.thumbImgName }"><br>
		<c:if test="${gvo.wow!=0 }">
		<input type="file" name="uploadImg" id="update_uploadImg" ><br>
		3MB 이하로 업로드해주세요
		</c:if>
	</td>
</tr>
<tr>
	<td>제목</td>
	<td><input type="text" name="title" id="update_title" size="60" value="${gvo.title }"></td>
</tr>
<tr>
	<td>내용</td>
	<td><textarea name="contents" id="update_content" cols="60" rows="5">${gvo.contents }</textarea></td>
</tr>
<tr>
<td>Category</td>
	<td>
		<select name="category" id="category">
			<option value="">------</option>
			<option value="practice">습작</option>
			<option value="series">연작</option>
			<option value="art">작품</option>
		</select>
	</td>
</tr>
<tr align="right">
	<td colspan="2"><input type="button" id="updateBtn" value="확인"></td>
</tr>
</table>
</form>
<script type="text/javascript">
$("#updateBtn").click(function(){
	if($("#category").val()==""){
		alert("카테고리를 선택해주세요");
		return;
	};
	$("#updateForm").submit();
});
</script>